Jump to content

User:Relata refero/monobook.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// [[User:Lupin/popups.js]]

importScript('User:Lupin/popups.js');

// [[User:Invitatious/unsigned2.js]] - unsigned comments script (enwiki)
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Invitatious/unsigned2.js' 
             + '&action=raw&ctype=text/javascript');

importScript('User:AzaToth/morebits.js');
importScript('User:AzaToth/twinklewarn.js');
importScript('User:AzaToth/twinklearv.js');
importScript('User:AzaToth/twinklespeedy.js');
importScript('User:AzaToth/twinkleimage.js');
importScript('User:AzaToth/twinklexfd.js');
importScript('User:AzaToth/twinkleprod.js');
importScript('User:AzaToth/twinkleprotect.js');
importScript('User:AzaToth/twinkleunlink.js');
importScript('User:AzaToth/twinklediff.js');

importScript('User:Cameltrader/Advisor.js');


importScript('User:Tra/userwatchlist.js'); //[[User:Tra/userwatchlist.js]]
importScript('User:Tra/whatlinksherewatchlist.js'); //[[User:Tra/whatlinksherewatchlist.js]]


// [[User:Ais523/hidetopcontrib.js]]
// By a suggestion by [[User:Discospinster]]
 
// This script color-codes lines according to who has the top contribution for a page.
//<pre><nowiki>
 
function hidetopcontrib()
{
  var i,li,a;
  li=document.getElementById("bodyContent");
  li=li.getElementsByTagName("li");
  i=-1;
  a=new Array();
  while(++i<li.length)
  {
    var s,t;
    t=li[i].innerHTML.match(/"\/wiki\/([^"]*)"/)[1];
    if(li[i].getElementsByTagName("strong").length>0)
      s="none";
    else
      s="";
    if(a[t]!=undefined) s=a[t]; else a[t]=s;
    if(s!="") li[i].style.display=(li[i].style.display=="none"?"list-item":"none");
  }
}
 
$(function () {
  if((location.href.indexOf("Special:Contributions")!=-1||
      location.href.indexOf("Special%3AContributions")!=-1)
     &&location.href.indexOf("&ais523")==-1&&location.href.indexOf("?ais523")==-1)
    mw.util.addPortletLink('p-cactions', 'javascript:hidetopcontrib()', 'show/hide top', 'ca-hidetop',
                   "Show/hide pages for which you're the top contributor", '');
});
//</nowiki></pre>
//


if (wgAction == 'edit' || wgAction == 'submit')
	addOnloadHook(addQPreviewButton);
 
 
function addQPreviewButton(){
	if (!window.qPreviewName) qPreviewName = 'QPreview';
	var accesskey = window.qPreviewKey || '';
	if (window.qPreviewAtBottom) 
		addSystemButton(qPreviewName, qPreview, 'btnQPreview', 'Quick Preview', accesskey);
	else
		addToolbarButton(qPreviewName, qPreview, 'btnQPreview', 'Quick Preview', accesskey);
}
 

 
function addSystemButton(name, onclick, id, tooltip, accesskey){ 
	var wpPreview = document.getElementById('wpPreview');
	if (!wpPreview) return;
	var btn = document.createElement('input');
	btn.type = 'button'; 
	if (name) btn.value = name; 
	if (onclick) btn.onclick = onclick;
	if (id) btn.id = id;
	if (tooltip) btn.title = tooltip; 
	if (accesskey) { 
		btn.accessKey = accesskey; 
		btn.title += ' [' + tooltipAccessKeyPrefix + btn.accessKey + ']';
	}	
	wpPreview.parentNode.insertBefore(btn, wpPreview);
	return btn;
}
 
 
function addToolbarButton(name, onclick, id, tooltip, accesskey){
	var toolbar = document.getElementById('toolbar');
	if (!toolbar) return;
	var btn = document.createElement('input');
	btn.type = 'button'; 
	btn.style.background = '#adbede';
	btn.style.height = '22px'; 
	btn.style.verticalAlign = 'middle';
	if (name) btn.value = name; 
	if (onclick) btn.onclick = onclick;
	if (id) btn.id = id;
	if (tooltip) btn.title = tooltip; 
	if (accesskey) btn.accessKey = accesskey; 
	toolbar.appendChild(btn);
	return btn;

}


   document.write('<script src="'
   + 'http://de.wikipedia.org/w/index.php?title=Benutzer:ASM/quickedit.js'
   + '&action=raw&ctype=text/javascript"></script>');